#ifndef __CBWORLD_H__
#define __CBWORLD_H__

USING_NS_CC;

struct SCollision
{
  CBBody* BodyA;
  CBBody* BodyB;
  CCPoint* CollisionPt;
};

class CCBall;

class CBWorld 
{
public:
  CBWorld(int x,int y);
  ~CBWorld(void);
public:
  void Tick(float deltatime,std::list<CCSprite*>& removelst);
  void Move(float deltatime);
  void Collision(std::list<CCSprite*>& removelst);
  void CalcForce(CBBody* body,CCPoint& force);
  void InitCalc();
  float coco2cbworldV(float x) {return x/mCBworld2CocoProportionV;}
  float cbworld2cocoV(float x) {return x*mCBworld2CocoProportionV;}
  float coco2cbworldH(float x) {return x/mCBworld2CocoProportionH;}
  float cbworld2cocoH(float x) {return x*mCBworld2CocoProportionH;}
public:
  float mCBworld2CocoProportionV;
  float mCBworld2CocoProportionH;
  std::list<CBBody*> mBodyLst;
  //std::list<SCollision*> mTempCollisionLst;
  CCPoint mGravity;
  float mWidth;
  float mHeight;
  bool mbLose;
};

#endif
